package com.kara.webapp.pages.admin.student;

import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.kara.entity.Clazz;
import com.kara.service.ClazzManager;


public class StudentAdmin {

  @Persist	
  @Property
  private long clazzId;
  
  private Clazz clazz;
  
  @Inject
  private ClazzManager clazzManager;
  
  @InjectPage
  private StudentEdit studentEdit;

  public void setMyClazzId(long clazzId) {
    this.clazzId = clazzId;
  }
  
  Object onActionFromCreateNewStudent(){
	studentEdit.setCurrentClazzId(clazzId); 
    return studentEdit;
  }
  Object onPassivate(){
	  return this.clazzId;
  }
  void onActivate(long clazzId){
	  this.clazzId=clazzId;
  }
}
